{% extends 'base.html' %}

{% block head_extra %}
  <script type="text/javascript" src="{{ STATIC_URL }}js/question.js"></script>
{% endblock head_extra %}

{% block content %}


<!-- INICIO DO JAVASCRIPT DE ATUALIZACAO DA PAGINA-->
<script language="JavaScript">
	//configure refresh interval (in seconds)
	var countDownInterval=30;
	//configure width of displayed text, in px (applicable only in NS4)
	var c_reloadwidth=200
</script>


<ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>

<script>
	var countDownTime=countDownInterval+1;
	function countDown(){
		countDownTime--;
	if (countDownTime <=0){
		countDownTime=countDownInterval;
		clearTimeout(counter)
		window.location.reload()
		return
	}
	if (document.all) //if IE 4+
		document.all.countDownText.innerText = countDownTime+" ";
	else if (document.getElementById) //else if NS6+
		document.getElementById("countDownText").innerHTML=countDownTime+" "
	else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
		document.c_reload.document.c_reload2.document.write('Pr&oacute;xima <a href="javascript:window.location.reload()">atualiza&ccedil;&atilde;o</a> em <b id="countDownText">'+countDownTime+' </b> segundos')
		document.c_reload.document.c_reload2.document.close()
	}
		counter=setTimeout("countDown()", 1000);
	}

	function startit(){
		if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
			document.write('Pr&oacute;xima <a href="javascript:window.location.reload()">atualiza&ccedil;&atilde;o</a> em <b id="countDownText">'+countDownTime+' </b> segundos')
			countDown()
	}

	if (document.all||document.getElementById)
		startit()
	else
		window.onload=startit
</script>
<br/>
<!-- FIM DO JAVASCRIPT -->



	<table class="table table-bordered table-striped">
		<thead>
        <tr>
          <!--<th>Código</th>  -->
          <th>Us&uacute;ario</th>
          <th>Prova</th>
          <th>Quest&atilde;o</th>
          <th>Pergunta</th>
          <th>Resposta do Us&uacute;ario</th>
          <th>Resultado</th>
        </tr>
      </thead>
      <tbody>
      	<tr>		
			{% for respostas in respostas_prova %}
				<!-- <td>{{ respostas.question.id }} </td> -->
				<td>{{ respostas.user_exam.user }} </td>
				<td>{{ respostas.user_exam.exam }} </td>
				<td>{{ respostas.question }} </td>
				<td>{{ respostas.question.example }} </td>
				<td>{{ respostas.closed_answer.letter }} - {{ respostas.closed_answer.answer }} </td>
				
				{% if respostas.closed_answer.correcao_prova == "ACERTOU." %}
					<!-- <td><i class="icon-ok""></i></td> -->
					<td><img src="\static\img\acerto.png" height="30" width="30"/></td>
				{% else %}
					<!-- <td><i class="icon-remove"></i></td> -->
					<td><img src="\static\img\erro.png" height="30" width="30"/></td>
				{% endif %}
          		</tr>
			{% endfor %}
		</tbody>
	</table>	

{% endblock content %}
